﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ResultSearch.ascx.cs" Inherits="Controls_ResultSearch" %>
<%@ Register src="AllowPagingDataList.ascx" tagname="AllowPagingDataList" tagprefix="uc1" %>
<%@ Import Namespace="DTO" %>
<script src="<%=Globals.ApplicationPath%>Jquery/jquery.js" type="text/javascript"></script>
<script src="<%=Globals.ApplicationPath%>Jquery/main.js" type="text/javascript"></script>

<style>
#preview{
	position:absolute;
	border:1px solid #ccc;
	background:#333;
	padding:5px;
	display:none;
	color:#fff;
	}
</style>
<asp:DataList ID="dtlProducts" EnableTheming="False" runat="server"
       DataKeyField="ID" GridLines="None" Width="100%" RepeatColumns="3" 
        BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
        CellPadding="4" ForeColor="Black">
       <SelectedItemStyle BackColor="#CC3333" Font-Bold="True" ForeColor="White" />
       <HeaderStyle BackColor="#333333" Font-Bold="True" ForeColor="White" />
       <ItemTemplate>
            <table cellpadding="6" cellspacing="6" >
                <tr>
                    <td class="titleProduct" align="center">
                        <a href='<%#Globals.ApplicationPath%>Products/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx'/>
                            <%#Eval("Title")%>
                        </a>                       
                        <asp:Image ID="Image2" ImageUrl="~/Images/imgNew.gif" runat="server" Visible='<%# Eval("IsNews") %>' />
                    </td>
                </tr>
                <tr>
                    <td align="center">
                         <a href='<%#Globals.ApplicationPath%>Products/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx' class="preview"><img src='<%#Eval("SmallImageUrl")%>' width="140px" alt="gallery thumbnail" />
                    </td>
                 </tr>
                <tr>
                    <td align="center">
                        Giá : <asp:Label runat="server" ID="lblGia" ForeColor="Red" Text='<%#Eval("StringUnitPrice")%>' /><br />
                        <a href='<%#Globals.ApplicationPath%>Products/<%#Eval("ID")%>/<%#Utils.ConvertToUnSign(DataBinder.Eval(Container.DataItem, "Title").ToString())%>.aspx'/>
                            chi tiết
                        </a>
                        <div class="details">
                            <a href='<%#Globals.ApplicationPath%>ShoppingCart.aspx?ID=<%#Eval("ID")%>'/>
                               ĐẶT HÀNG
                            </a>
                        </div>
                    </td>
                </tr>
            </table>
       </ItemTemplate>
       <FooterStyle BackColor="#CCCC99" ForeColor="Black" />
       <ItemStyle BorderColor="Orange" />
    </asp:DataList>
<asp:ObjectDataSource runat="server" ID="objAllProduct" TypeName="BLL.Store.Product" SelectMethod="ListProductBySearch">
    <SelectParameters>
        <asp:QueryStringParameter Name="name" QueryStringField="Title" Type="String" />
        <asp:QueryStringParameter Name="departmentID" QueryStringField="Dep" Type="Int32" />
        <asp:QueryStringParameter Name="fromPrice" QueryStringField="FromPrice" Type="Int32" />
        <asp:QueryStringParameter Name="endPrice" QueryStringField="EndPrice" Type="Int32" />
    </SelectParameters>
</asp:ObjectDataSource>
<uc1:AllowPagingDataList ID="AllowPagingDataList1" runat="server" />
  <asp:Literal runat="server" ID="lblText" />